package com.chaoyong.higo.cainiaowo;

import com.chaoyong.higo.R;

import android.content.Context;
import android.support.v7.widget.Toolbar;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class CTitleBar extends RelativeLayout {

	private TextView mTextTitle;
	private Button mRightButton;

	public CTitleBar(Context context) {
		super(context);
	}

	public CTitleBar(Context context, AttributeSet attrs) {
		super(context, attrs);
		LayoutInflater.from(context).inflate(R.layout.ctitle_bar, this, true);
		mTextTitle = (TextView) findViewById(R.id.ctoolbar_title);
		mRightButton = (Button) findViewById(R.id.ctoolbar_rightButton);
	}

	public void setRightButtonOnClickListener(OnClickListener li) {

		mRightButton.setOnClickListener(li);
	}

	public void setRightButtonText(CharSequence text) {
		mRightButton.setText(text);
		mRightButton.setVisibility(INVISIBLE);
	}

	public Button getRightButton() {

		return this.mRightButton;
	}

}
